#Robot sonars
define robot_sonars ranger
(
      # number of sonars
      scount 15

      # [xpos ypos heading]
      spose[0]  [ 0.0 -0.4   -90]	
      spose[1]  [ 0.2 -0.4  -67.5]	
      spose[2]  [ 0.3 -0.3   -45]	
      spose[3]  [ 0.4 -0.15  -22.5]
      spose[4]  [ 0.4  0.0     0]		
      spose[5]  [ 0.4  0.15   22.5]	
      spose[6]  [ 0.3  0.3    45]	
      spose[7]  [ 0.2 0.4  67.5]	
      spose[8]  [ 0.0  0.4    90]	
      spose[9]  [-0.4  0.1   160]		
      spose[10] [-0.4 -0.1  -160]
      spose[11] [-0.19 -0.4  -112.5]
      spose[12] [-0.19  0.4  112.5]	
      spose[13] [-0.3 -0.3  -135]
      spose[14] [-0.3  0.3  135]	
      
      #[range_min range_max view_angle]
      sview [0.0 3.0 15]

      # define the size of each transducer
      # [xsize ysize] in meters
      ssize [0.01 0.05]
)

# Robot body
define robot position
(
        size [0.8 0.8 0.5]

    origin [0.0 0 0 0] 

 
	block
	(
		points 9
		point[0] [0.3 0.0]
		point[1] [0.6 0.0]
		point[2] [0.8 0.2]
		point[3] [0.8 0.6]
		point[4] [0.6 0.8]
		point[5] [0.3 0.8]
		point[6] [0.0 0.5]
		#point[7] [0.0 0.5]
		#point[8] [0.2 0.5]
		#point[9] [0.2 0.3]
		#point[10] [0.0 0.3]
		point[7] [0.0 0.3]
		point[8] [0.3 0.0]
		
		z [0 1]
	)
	
	block
	(
		points 5
		point[0] [0.3 0.0]
		point[1] [0.1 0.2]
		point[2] [0.1 0.1]
		point[3] [0.2 0.0]
		point[4] [0.3 0.0]
		
		z [0.5 1]
	)
	
	block
	(
		points 5
		point[0] [0.3 0.8]
		point[1] [0.2 0.8]
		point[2] [0.1 0.7]
		point[3] [0.1 0.6]
		point[4] [0.3 0.8]
		
		z [0.5 1]
	)
	

	
	
	# differential steering model
	drive "diff"

	
	# sensors attached to bigbob
	robot_sonars()  
	
	obstacle_return 1           	# Can hit things.
	ranger_return 1             	# reflects sonar beams
) 



